//
//  ActivityButton.m
//  爱鲜蜂
//
//  Created by 廖易诚 on 16/8/31.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "ActivityButton.h"

@implementation ActivityButton

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        UIImageView *iconImageView = [[UIImageView alloc] init];
        [self addSubview:iconImageView];
        self.iconImageView = iconImageView;
        iconImageView.contentMode = UIViewContentModeScaleAspectFit;
        
        UILabel *textLabel = [[UILabel alloc] init];
        textLabel.textAlignment = NSTextAlignmentCenter;
        textLabel.font = [UIFont systemFontOfSize:13];
        [self addSubview:textLabel];
        self.textLabel = textLabel;
        
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.iconImageView.hm_x = 10;
    self.iconImageView.hm_y = 10;
    self.iconImageView.hm_width = self.hm_width-20;
    self.iconImageView.hm_height = self.hm_height * 0.6 - 20;
    
    self.textLabel.hm_x = 0;
    self.textLabel.hm_y = self.iconImageView.hm_height + 15;
    self.textLabel.hm_width = self.hm_width;
    self.textLabel.hm_height = self.hm_height * 0.4;
}

@end
